<%@tag pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib prefix="consignum" tagdir="/WEB-INF/tags"%>
<%@attribute name="styleClass"%>
<%@attribute name="style"%>
<%@attribute name="value"%>
<%@attribute name="colspan"%>
<%@attribute name="limitCharacterInRow"%>
<%@attribute name="title" type="java.lang.Boolean"%>
<%@attribute name="rendered" type="java.lang.Boolean"%>
<c:if test="${fn:length(value) > limitCharacterInRow}" var="isLimited">
  <c:set var="valueLimited" value="${fn:substring(value, 0, limitCharacterInRow)}..." />
</c:if>
<c:if test="${!isLimited}">
   <c:set var="valueLimited" value="${value}" />
</c:if>
<c:if test="${empty rendered or rendered eq true}">
	<c:if test="${title eq true}">
		<th  
		     <consignum:renderedField field="colspan" value="${colspan}" /> 
		     <consignum:renderedField field="style" value="${style}" />
		     <consignum:renderedField field="class" value="${styleClass}"  defaultValue="labelConsignum"/> >
			<c:if test="${empty valueLimited}">
			  <jsp:doBody />
		   </c:if>
		   <c:if test="${not empty valueLimited}">
		   	 <c:out value="${valueLimited}" />
		   </c:if>
		</th>
	</c:if>
	<c:if test="${empty title or title eq false}" >
		<td  
		    <consignum:renderedField field="colspan" value="${colspan}" /> 
		     <consignum:renderedField field="style" value="${style}" />
		      <consignum:renderedField field="class" value="${styleClass}" /> >
		  <c:if test="${empty valueLimited}">
					 <jsp:doBody />
		   </c:if>
		   <c:if test="${not empty valueLimited}">
		   	 	 <c:out value="${valueLimited}" />
		   </c:if>
		</td>
	</c:if>
</c:if>

